package net;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Map;
import java.util.Properties;

public class TestClient {

	public static void main(String[] args) throws Exception{
//		Map<String, String> env=System.getenv();
//		for(String key:env.keySet()){
//			System.out.println(key+"\t"+env.get(key));
//		}
//		Properties envs= System.getProperties();
//		for(Object key:envs.keySet()){
//			System.out.println(key+"\t\t"+envs.get(key));
//		}
		
		String encodding=System.getProperty("sun.jnu.encoding");
		Socket socket=new Socket("127.0.0.1", 6666);
		InputStream in=socket.getInputStream();
		BufferedReader reader=new BufferedReader(new InputStreamReader(in));
		OutputStream out=socket.getOutputStream();
		
		String tip=reader.readLine();
		System.out.println(tip);
		out.write((encodding+"\n").getBytes());
		String info=reader.readLine();
		System.out.println(info);
		out.close();
		reader.close();		
		
	}

}




